// src/features/channels/api/use-get-channels.ts
import {MARK_DATA_URL} from "@/lib/social/constants";

interface Props {
    workspaceId: string
}

export const useGetChannels = async ({workspaceId}: Props) => {
    const res = await fetch(
        // `${MARK_DATA_URL}/channels?workspaceId=${workspaceId}`,
        `/api/channels?workspaceId=${workspaceId}`,
    )
    let data = await res.json()
    // data = data.channels
    const isLoading = data === undefined

    return {data, isLoading}
}